package cn.xscrum.vtsp.service.impl;

import java.util.List;

import cn.xscrum.vtsp.domain.VtspPublish;
import cn.xscrum.vtsp.mapper.VtspPublishMapper;
import cn.xscrum.vtsp.service.IVtspPublishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.xscrum.vtsp.domain.VtspVolunteer;
import cn.xscrum.common.core.text.Convert;

/**
 * 志愿者入队信息Service业务层处理
 *
 * @author Zxing
 * @date 2021-10-01
 */
@Service
public class VtspPublishServiceImpl implements IVtspPublishService
{
    @Autowired
    private VtspPublishMapper vtspPublishMapper;

    /**
     * 查询志愿者信息
     *
     * @param volunteerId 志愿者信息ID
     * @return 志愿者信息
     */
    @Override
    public VtspVolunteer selectVtspVolunteerById(Long volunteerId)
    {
        return vtspPublishMapper.selectVtspVolunteerById(volunteerId);
    }

    /**
     * 查询志愿者信息列表
     *
     * @param vtspPublish 志愿者信息
     * @return 志愿者信息
     */
    @Override
    public List<VtspPublish> selectVtspVolunteerList(VtspPublish vtspPublish)
    {
        return vtspPublishMapper.selectVtspVolunteerList(vtspPublish);
    }

    /**
     * 拒绝 入队申请(member_state 1 -> 3)
     *
     * @param volunteerId 需要修改的数据ID
     * @return 结果
     */
    public int refuseVtspVolunteerById(Long volunteerId) {
        return vtspPublishMapper.refuseVtspVolunteerById(volunteerId);
    }


    /**
     * 批量拒绝 入队申请(member_state 1 -> 3)
     *
     * @param volunteerIds 需要修改的数据ID
     * @return 结果
     */
    public int refuseVtspVolunteerByIds(String volunteerIds) {
        return vtspPublishMapper.refuseVtspVolunteerByIds(Convert.toStrArray(volunteerIds));
    }

    /**
     * 同意 入队申请(member_state 1 -> 6)
     *
     * @param volunteerId 需要修改的数据ID
     * @return 结果
     */
    public int acceptVtspVolunteerById(Long volunteerId) {
        return vtspPublishMapper.acceptVtspVolunteerById(volunteerId);
    }

    /**
     * 批量同意 入队申请(member_state 1 -> 6)
     *
     * @param volunteerIds 需要修改的数据ID
     * @return 结果
     */
    public int acceptVtspVolunteerByIds(String volunteerIds) {
        return vtspPublishMapper.acceptVtspVolunteerByIds(Convert.toStrArray(volunteerIds));
    }
}
